#pragma once

#include <windows.h>
#include "ccirc.h"
DWORD WINAPI RxSerial( LPVOID lpParam ) ;

class ccom
{
public:
	enum ccomError {
		Ok=0,
		Error
	} ;
	ccom(char * portName);
	ccomError Open(void);
	ccomError Close(void);
	ccomError Write(const char* buffer, unsigned int size);
	ccomError Configure(DWORD baudRate, BYTE parity, BYTE stopbits);
	ccomError getNextChar(unsigned char *c);
	static unsigned int _stdcall ccom::RxSerial(void* arg);

    ccirc *getBuffer(void);
	OVERLAPPED ov;
	~ccom(void);
private:
	WCHAR m_portName[100];
	HANDLE m_hSerialComm;
	ccirc * circBuffer;
    

};

